#include <iostream>
#include<string>
using namespace std;
int find(int i)
{
    if (i % 2 == 0)return 2;
    else return 1;
}
int main()
{
    int x;
    cin >> x;
    int num = 0;
    for (int j = 1; j <= x; j++)
    {
        int tmp = j;
        for (int i = 1; tmp > 0; i++)
        {
            // 判断i的奇偶性
            int p = find(i);
            //奇数的判断
            if (p == 1) {
                if ((tmp % 10) % 2 != 1)
                {
                    tmp = -1000;
                }
            }
            //偶数位的判断
            if (p == 2)
            {
                if ((tmp % 10) % 2 !=0 )
                {
                    tmp = -1000;
                }
            }
            tmp /= 10;
        }
        if (tmp == 0)num++;
    }
    cout << num << endl;
    return 0;
}
